package com.dyna.demo.dictConvert.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.dyna.constants.DateFatter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 
 * @author Admin
 * @TableName user
 */

@Data
@ApiModel(value = "用户表")
@TableName(value ="sys_user")
public class UserDemo implements Serializable {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "用户uuid")
    private Long userId;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名")
    private String userName;

    @NotBlank(message = "用户姓名不能为空")
    @ApiModelProperty(value = "用户姓名")
    private String nickName;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(value = "密码")
    private String password;

    @NotNull(message = "性别不能为空")
    @ApiModelProperty(value = "性别", notes = "0：男，1女，2未知")
//    @Dict(dictType = "sex")
    private Integer sex;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    private String phone;

    @ApiModelProperty(value = "身份证")
    @NotBlank(message = "身份证不能为空")
    private String idCard;

//    @Dict(dictType = "is_admin")
    @ApiModelProperty(value = "是否管理员")
    private Integer adminFlag;

    @ApiModelProperty(value = "登录状态")
    @TableField(exist = false)
    private Integer loginStatus;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = DateFatter.YYYY_MM_DD_HH_MM_SS)
    private LocalDateTime createTime;

    @TableLogic
    @ApiModelProperty(value = "删除标识", notes = "0: 未删除，2删除")
    private Integer delFlag;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

}